<div [formGroup]='form' class="full-width">
  <span>{{label}}</span>
  <mat-chip-list>
    <mat-chip selected="true" color="primary" *ngFor="let member of items">
      <span>{{member.name}}</span>
      <span class="remove-tag" (click)="removeMember(member)">X</span>
    </mat-chip>
  </mat-chip-list>
  <mat-form-field class="full-width" *ngIf="displayInput">
    <input matInput type="text" formControlName="memberSearch" [placeholder]="placeholderText" [matAutocomplete]="autoMember">
    <mat-autocomplete #autoMember="matAutocomplete" [displayWith]='displayUser'>
      <mat-option *ngFor="let option of memberResults$ | async" 
      [value]='option'
      (onSelectionChange)="handleMemberSelection(option)">
        <span>{{option.name}}</span>
      </mat-option>
    </mat-autocomplete>
  </mat-form-field>
</div>
